!function (win) {
    const ExtUi = function () {
        this.version = '0.0.1';
    };
    ExtUi.prototype.def = function (factory) {
        const that = this, register = function () {
            const setApp = function(app, exports){
                extui[app] = exports;
            };
            typeof factory === 'function' && factory(function(app, exports){
                setApp(app, exports);
            });
        };
        register.call(that);
    };
    !('extui' in win) && (win.extui = new ExtUi());
}(window);